package com.yu.crm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yu.crm.domain.pojo.WfStatusEnum;
import com.yu.crm.mapper.WfStatusEnumMapper;
import com.yu.crm.service.WfStatusEnumService;
import com.yxzz.common.helper.DataHelpers;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 应用状态枚举表 服务实现类
 * </p>
 *
 * @author donnie-bin
 * @since 2019-10-08
 */
@Service
public class WfStatusEnumServiceImpl extends ServiceImpl<WfStatusEnumMapper, WfStatusEnum> implements WfStatusEnumService {

    /**
     * 列表查询
     * @param appId
     * @param keyword
     * @return
     */
    @Override
    public List<WfStatusEnum> getList(String appId, String keyword) {
        QueryWrapper<WfStatusEnum> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("app_id",appId);
        queryWrapper.eq("is_deleted",0);
        if (DataHelpers.isNotEmptyString(keyword)) {
            queryWrapper.like("status_name",keyword);
        }
        return baseMapper.selectList(queryWrapper);
    }
}
